<h1>Listing roles of users</h1>

<table>
  <tr>
    <th>Employee</th>
    <th>Role</th>
  </tr>

<% @roles_users.each do |roles_user| %>
  <tr>
    <% @user = User.find(roles_user.user_id)  %>
    <% @role = Role.find(roles_user.role_id)  %>
    <td><%=h @user.login  %></td>
    <td><%=h @role.name %></td>
    <td><%= link_to 'Show', roles_user %></td>
    <td><%= link_to 'Edit', edit_roles_user_path(roles_user) %></td>
    <td><%= link_to 'Destroy', roles_user, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New roles_user', new_roles_user_path %>